package eerbaar.client.internal.ctr.noun;

import eerbaar.client.exp.IExp;
import eerbaar.client.exp.INounFactory;

public class NounFactory implements INounFactory {

    private final IExp[] array = new IExp[] { new Bone(), new Tree(),
            new House(), new Bug(), new Pet(), new Dog(), new Persona(),
            new BonePack() };

    @Override
    public IExp create(String string) {

        IExp result = null;

        for (IExp exp : this.array) {

            if (exp.toString().equals(string)) {

                result = exp;
                break;
            }

        }

        return result;
    }

    @Override
    public boolean isNoun(String string) {

        IExp exp = create(string);
        return (exp != null);
    }

}
